import { defineStore } from 'pinia'
import { Graph } from '@antv/x6'

export const useYkEditorDrawStore = defineStore('YkEditorDrawStore', {
  state: () => ({
    graph: null as Graph,
    size: {
      width: 0,
      height: 0
    },
    background: {
      file: null
    },
    toolbar: {
      // 显示边线工具
      showEdgeTool: true,
      // 显示节点连接桩
      showNodePort: false,
      // 允许交互禁用节点
      enableInteractingDisable: false
    },
    defaultLineStyle: {
      attrs: {
        line: {
          stroke: '#FFFFFF',
          targetMarker: { name: 'classic', size: 6 },
          sourceMarker: { name: '', size: 0 }
        }
      },
      router: { name: 'normal' },
      connector: { name: 'normal' }
    }
  }),
  actions: {
  }
})
